package o;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.TypedValue;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import androidx.annotation.StyleableRes;

@RestrictTo({d.ˊ})
public class cw {
    private final TypedArray ˋ;
    private final Context ˎ;
    private TypedValue ॱ;

    public static cw ˊ(Context context, AttributeSet attributeSet, int[] iArr) {
        return new cw(context, context.obtainStyledAttributes(attributeSet, iArr));
    }

    public static cw ॱ(Context context, AttributeSet attributeSet, int[] iArr, int i, int i2) {
        return new cw(context, context.obtainStyledAttributes(attributeSet, iArr, i, i2));
    }

    public static cw ˊ(Context context, int i, int[] iArr) {
        return new cw(context, context.obtainStyledAttributes(i, iArr));
    }

    private cw(Context context, TypedArray typedArray) {
        this.ˎ = context;
        this.ˋ = typedArray;
    }

    public Drawable ˋ(int i) {
        if (this.ˋ.hasValue(i)) {
            int resourceId = this.ˋ.getResourceId(i, 0);
            if (resourceId != 0) {
                return ar.ˋ(this.ˎ, resourceId);
            }
        }
        return this.ˋ.getDrawable(i);
    }

    public Drawable ˎ(int i) {
        if (this.ˋ.hasValue(i)) {
            int resourceId = this.ˋ.getResourceId(i, 0);
            if (resourceId != 0) {
                return bx.ˋ().ˋ(this.ˎ, resourceId, true);
            }
        }
        return null;
    }

    @Nullable
    public Typeface ॱ(@StyleableRes int i, int i2, @Nullable fv.d dVar) {
        int resourceId = this.ˋ.getResourceId(i, 0);
        if (resourceId == 0) {
            return null;
        }
        if (this.ॱ == null) {
            this.ॱ = new TypedValue();
        }
        return fv.ˋ(this.ˎ, resourceId, this.ॱ, i2, dVar);
    }

    public CharSequence ˊ(int i) {
        return this.ˋ.getText(i);
    }

    public String ˏ(int i) {
        return this.ˋ.getString(i);
    }

    public boolean ˋ(int i, boolean z) {
        return this.ˋ.getBoolean(i, z);
    }

    public int ॱ(int i, int i2) {
        return this.ˋ.getInt(i, i2);
    }

    public float ॱ(int i, float f) {
        return this.ˋ.getFloat(i, f);
    }

    public int ˋ(int i, int i2) {
        return this.ˋ.getColor(i, i2);
    }

    public ColorStateList ॱ(int i) {
        if (this.ˋ.hasValue(i)) {
            int resourceId = this.ˋ.getResourceId(i, 0);
            if (resourceId != 0) {
                ColorStateList ˊ = ar.ˊ(this.ˎ, resourceId);
                if (ˊ != null) {
                    return ˊ;
                }
            }
        }
        return this.ˋ.getColorStateList(i);
    }

    public int ˏ(int i, int i2) {
        return this.ˋ.getInteger(i, i2);
    }

    public float ˏ(int i, float f) {
        return this.ˋ.getDimension(i, f);
    }

    public int ˊ(int i, int i2) {
        return this.ˋ.getDimensionPixelOffset(i, i2);
    }

    public int ˎ(int i, int i2) {
        return this.ˋ.getDimensionPixelSize(i, i2);
    }

    public int ʼ(int i, int i2) {
        return this.ˋ.getLayoutDimension(i, i2);
    }

    public int ॱॱ(int i, int i2) {
        return this.ˋ.getResourceId(i, i2);
    }

    public CharSequence[] ʻ(int i) {
        return this.ˋ.getTextArray(i);
    }

    public boolean ᐝ(int i) {
        return this.ˋ.hasValue(i);
    }

    public void ॱ() {
        this.ˋ.recycle();
    }
}
